<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.5.1.js"></script>
</head>
<body>
<div id="outer">
    <div id="inner">
        <input type="text" id="username" name="username" >
        <div>
            <textarea id="area">haha</textarea>
        </div>
    </div>
</div>
<button type="button" onclick="get()">获取值</button>
<script type="text/javascript">
    function get() {
        // val()省略其中的参数:获取值
        let x = $(":input").val() ;
        alert(x);
        x = $("#area").html() ;
        x = $("#area").text() ;
    }
</script>
</body>
</html>